package com.pda.xinmazhi.net;



import com.pda.xinmazhi.bean.ContainerDetailBean;
import com.pda.xinmazhi.bean.DeliveryInfoBean;
import com.pda.xinmazhi.bean.LatheMachinBean;
import com.pda.xinmazhi.bean.LatheOrderBean;
import com.pda.xinmazhi.bean.LoginBean;
import com.pda.xinmazhi.bean.OtherInfoBean;
import com.pda.xinmazhi.bean.ScanResultBean;
import com.pda.xinmazhi.bean.ScheduleCallDetail;
import com.pda.xinmazhi.bean.SurplusDetailBean;
import com.pda.xinmazhi.bean.UserBean;
import com.pda.xinmazhi.bean.request.BackConfirmRequest;
import com.pda.xinmazhi.bean.request.CallCarryRequest;
import com.pda.xinmazhi.bean.request.EmptyRequest;
import com.pda.xinmazhi.bean.request.OtherRequest;
import com.pda.xinmazhi.bean.request.QRcodeRequest;
import com.pda.xinmazhi.bean.request.RawInRequest;
import com.pda.xinmazhi.bean.request.SurplusConfirmRequest;
import com.wangshen.base.net.bean.BaseAppEntity;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface ApiService {
    /**
     * 登录
     * @return
     */
    @POST("/pda/pdaLogin/login")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<LoginBean>> signIn(@Body RequestBody body);
    /**
     * 扫码验证
     * @return
     */
    @POST("/pda/about/scanTheQRCodeToVerify")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<ScanResultBean>> scanTheQRCodeToVerify(@Body QRcodeRequest body);
    /**
     * 根据生产订单号查询订单相关信息
     * @return
     */
    @GET("/pda/empty/container-detail")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<ContainerDetailBean>> getContainerDetail(@Query("container") String container);

    /**
     * 空桶清洗
     * @return
     */
    @GET("/pda/empty/container-wash")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<ContainerDetailBean>> getContainerWash(@Query("container") String container);

    /**
     * 空锥桶入库
     * @return
     */
    @POST("/pda/empty/empty-container-in")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<LoginBean>> emptyIn(@Body EmptyRequest body);

    /**
     * 空锥桶出库
     * @return
     */
    @POST("/pda/empty/empty-container-out")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<LoginBean>> emptyOut(@Body EmptyRequest body);
    /**
     * 根据工作中心查询机台下拉列表
     * @return
     */
    @GET("/pda/about/getLatheListByCenter/{centerCode}")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<List<LatheMachinBean>>> getLatheListByCenter(@Path("centerCode") String centerCode);

    /**
     * 获得结余明细
     * @return
     */
    @GET("/pda/surplus/surplus-detail")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<SurplusDetailBean>> getSurplusDetail(@Query("latheCode") String latheCode);

    /**
     * 结余确认
     * @return
     */
    @POST("/pda/surplus/surplus-confirm")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<LoginBean>> surplusConfirm(@Body SurplusConfirmRequest body);
    /**
     * 结余确认
     * @return
     */
    @POST("/pda/surplus/back-confirm")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<LoginBean>> backConfirm(@Body BackConfirmRequest body);

    /**
     * 获得结余明细
     * @return
     */
    @GET("/pda/delivery/other-stock-info")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<OtherInfoBean>> getOtherInfo(@Query("storageBinId") String storageBinId, @Query("container") String container);


    /**
     * 其他出库确认
     * @return
     */
    @POST("/pda/delivery/other-out-confirm")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<LoginBean>> otherConfrim(@Body OtherRequest body);

    /**
     * 根据机台查询可叫料生产订单列表
     * @return
     */
    @GET("/pda/delivery/schedule-can-list")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<List<LatheOrderBean>>> getOrderListByLathe(@Query("latheCode") String latheCode, @Query("proOrderNo")String proOrderNo);

    /**
     * 根据机台查询已叫料生产订单列表
     * @return
     */
    @GET("/pda/delivery/schedule-already-list")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<List<LatheOrderBean>>> getAlreadyOrderListByLathe(@Query("latheCode") String latheCode,@Query("proOrderNo")String proOrderNo);

    /**
     * 叫料详情
     * @return
     */
    @GET("/pda/delivery/schedule-call-detail")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<ScheduleCallDetail>> getOrderListByLatheDetail(@Query("latheCode") String latheCode, @Query("proOrderNo")String proOrderNo);

    /**
     * 呼叫送料
     * @return
     */
    @POST("/pda/delivery/call-confirm")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<UserBean>> callCarry(@Body CallCarryRequest request);

    /**
     * 根据工序流程查询出库统计/明细
     * @return
     */
    @GET("/pda/delivery/delivery-info")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<DeliveryInfoBean>> getDeliveryInfoByFlowId(@Query("proOrderNo") String proOrderNo);

    /**
     * 原料下拉查询
     * @return
     */
    @GET("/pda/entry/feedstock-pull-down")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<List<ArticleBean>>> getArticleList();

    /**
     * 原料入库
     * @return
     */
    @POST("/pda/entry/feedstock-entry-confirm")
    @Headers("Content-Type:application/json;charset=UTF-8")
    Observable<BaseAppEntity<UserBean>> callRawIn(@Body RawInRequest request);
}


